package com.order.manager.Model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 
 * @TableName menu_info
 */
@TableName(value ="menu_info")
@Data
public class MenuInfo implements Serializable {
    /**
     * 菜品id
     */
    @TableId
    private String menuId;

    /**
     * 菜品名称
     */
    private String menuName;

    /**
     * 菜品价格
     */
    private BigDecimal menuPrice;

    /**
     * 菜品图片
     */
    private String menuPicture;

    /**
     * 商店id
     */
    private String shopId;

    /**
     * 上架时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date inputTime;

    /**
     * 状态
0为停售
1为起售
     */
    private Integer state;

    /**
     * 描述
     */
    private String menuDescribe;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        MenuInfo other = (MenuInfo) that;
        return (this.getMenuId() == null ? other.getMenuId() == null : this.getMenuId().equals(other.getMenuId()))
            && (this.getMenuName() == null ? other.getMenuName() == null : this.getMenuName().equals(other.getMenuName()))
            && (this.getMenuPrice() == null ? other.getMenuPrice() == null : this.getMenuPrice().equals(other.getMenuPrice()))
            && (this.getMenuPicture() == null ? other.getMenuPicture() == null : this.getMenuPicture().equals(other.getMenuPicture()))
            && (this.getShopId() == null ? other.getShopId() == null : this.getShopId().equals(other.getShopId()))
            && (this.getInputTime() == null ? other.getInputTime() == null : this.getInputTime().equals(other.getInputTime()))
            && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
            && (this.getMenuDescribe() == null ? other.getMenuDescribe() == null : this.getMenuDescribe().equals(other.getMenuDescribe()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getMenuId() == null) ? 0 : getMenuId().hashCode());
        result = prime * result + ((getMenuName() == null) ? 0 : getMenuName().hashCode());
        result = prime * result + ((getMenuPrice() == null) ? 0 : getMenuPrice().hashCode());
        result = prime * result + ((getMenuPicture() == null) ? 0 : getMenuPicture().hashCode());
        result = prime * result + ((getShopId() == null) ? 0 : getShopId().hashCode());
        result = prime * result + ((getInputTime() == null) ? 0 : getInputTime().hashCode());
        result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
        result = prime * result + ((getMenuDescribe() == null) ? 0 : getMenuDescribe().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", menuId=").append(menuId);
        sb.append(", menuName=").append(menuName);
        sb.append(", menuPrice=").append(menuPrice);
        sb.append(", menuPicture=").append(menuPicture);
        sb.append(", shopId=").append(shopId);
        sb.append(", inputTime=").append(inputTime);
        sb.append(", state=").append(state);
        sb.append(", menuDescribe=").append(menuDescribe);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}